import com.wzs.setting.domain.DicValue;
import com.wzs.setting.service.DicValueService;
import com.wzs.vo.PaginationVO;
import com.wzs.workbench.domain.Novel;
import com.wzs.workbench.service.NovelService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class testUUID {

    String config = "applicationContext.xml";
    ApplicationContext ctx = new ClassPathXmlApplicationContext(config);

    @Test
    public void test() {
        DicValueService dicValueService = (DicValueService) ctx.getBean("dicValueService");

        Map<String, List<DicValue>> map = dicValueService.getAll();
        System.out.println(map);
    }

    @Test
    public void testNovelPageList() {

        NovelService novelService = (NovelService) ctx.getBean("novelService");
        HashMap<String, Object> map = new HashMap<>();
        map.put("pageSize", 2);
        map.put("skipCount", 0);
        map.put("novelName", "");
        map.put("novelColumn", "奇幻玄幻");

        PaginationVO<Novel> vo = novelService.novelPageList(map);

        System.out.println("------------------------total=" + vo.getTotal());
        System.out.println("------------------------dataList" + vo.getDataList());

        List<Novel> nList = vo.getDataList();
        for (Novel novel : nList) {
            System.out.println(novel.getName());
        }

    }
}
